package com.zany;

import com.zany.login.service.LoginService;
import com.zany.login.vo.UserResourceVO;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class SpringHelper {
    private  static ClassPathXmlApplicationContext context  = new ClassPathXmlApplicationContext("classpath:config/*.xml");


    public static Object getBean(String className){

        return context.getBean(className);
    }
//
//    public static void main(String[] args) {
//        LoginService loginService = (LoginService)SpringHelper.getBean("loginService");
//        System.out.println(loginService);
//        List<UserResourceVO> topMenuAdmin = loginService.getTopMenuAdmin();
//        for(UserResourceVO userResourceVO:topMenuAdmin){
//            String url = userResourceVO.getUrl();
//            System.out.println(url);
//        }
//    }


}
